import request from '@/utils/request'

// 获取所有菜单信息
export const getAllMenus = () => {
  return request({
    method: 'get',
    url: '/boss/menu/getAll'
  })
}

// 新增或编辑菜单接口函数
export const createOrUpdateMenu = (data) => {
  return request({
    method: 'post',
    url: '/boss/menu/saveOrUpdate',
    data
  })
}

// 根据id 删除某个菜单
export const deleteMenu = (id = 0) => {
  return request({
    method: 'delete',
    url: `/boss/menu/${id}`
  })
}

// 获取菜单详情
export const getEditMenuInfo = (id = 0) => {
  return request({
    method: 'get',
    url: '/boss/menu/getEditMenuInfo',
    params: { id }
  })
}
